package com.hgb.mall.admin.services.impl;


import com.hgb.mall.admin.services.UmsMemberLevelService;
import com.hgb.mall.mbg.entity.UmsMemberLevel;
import com.hgb.mall.mbg.mapper.UmsMemberLevelDynamicSqlSupport;
import com.hgb.mall.mbg.mapper.UmsMemberLevelMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

import static org.mybatis.dynamic.sql.SqlBuilder.isEqualTo;

/**
 * 会员等级管理Service实现类
 * Created by hgb on 2020/4/26.
 */
@Service
public class UmsMemberLevelServiceImpl implements UmsMemberLevelService {
    @Autowired
    private UmsMemberLevelMapper memberLevelMapper;

    @Override
    public List<UmsMemberLevel> list(Integer defaultStatus) {
        return memberLevelMapper
                .select(c -> c.where(UmsMemberLevelDynamicSqlSupport.defaultStatus, isEqualTo(defaultStatus)));
    }
}
